{% macro filter_options(btn_class='dropdown-toggle') %}
    <div class="btn-group">
        <button type="button" class="btn btn-default"><i class="fa fa-filter"></i> {{ _gettext('Add Filter') }}</button>

        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
            <span class="sr-only">Toggle Dropdown</span>
        </button>
        <ul class="dropdown-menu field-filters">
            {% for k in filter_groups %}
            <li>
                <a href="javascript:void(0)" class="filter" onclick="return false;">{{ k }}</a>
            </li>
            {% endfor %}
        </ul>
    </div>
{% endmacro %}

{% macro filter_form() %}
    <div class="row">
        <div class="col-md-6">
    <form id="filter_form" method="GET" action="{{ return_url }}">
        <div class="pull-right">
            <button type="submit" class="btn btn-primary" style="display: none">{{ _gettext('Apply') }}</button>
            {% if active_filters %}
            <a href="{{ clear_search_url }}" class="btn btn-default">{{ _gettext('Reset Filters') }}</a>
            {% endif %}
        </div>

        <table class="filters"></table>
    </form>
    <div class="clearfix"></div>
        </div>
    </div>
{% endmacro %}

{% macro search_form(input_class="col-md-2") %}
<form method="GET" action="{{ return_url }}" class="btn-group" role="search">
    <div class="input-group pull-right" style="width:150px">
        {% if sort_column is not none %}
            <input type="hidden" name="sort" value="{{ sort_column }}">
        {% endif %}
        {% if sort_desc %}
            <input type="hidden" name="desc" value="{{ sort_desc }}">
        {% endif %}
        {% if search %}
            <input type="text" name="search" value="{{ search }}" class="{{ input_class }} form-control input-sm pull-right" placeholder="{{ _gettext('Search') }}">
            <div class="input-group-btn">
                <a href="{{ clear_search_url }}" class="btn btn-sm btn-default"><i class="fa fa-times glyphicon glyphicon-remove"></i></a>
            </div>
        {% else %}
            <input type="text" name="search" value="" class="{{ input_class }} form-control input-xs pull-right" placeholder="{{ _gettext('Search') }}">
        {% endif %}
    </div>
</form>
{% endmacro %}
